var webpack = require('webpack');
var htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {

	entry: __dirname + "/src/main.js",
	output: {
		// path: __dirname + "/public",
		path: __dirname + "/dist/js",
		filename: "[name]-[hash].js"
	},

	module: {
		loaders: [
			{
		        test: /\.json$/,
		        use: 'json-loader'
	        },
	        {
				test: /\.css$/,
				loader: "style-loader!css-loader"
		    },
			{
				test: /\.(png|jpg|gif)$/,
				loader: "url-loader?limit=70000&name=img/[name].[hash:8].[ext]"
			},
			{
				test: /\.js$/,
				exclude: /node_modules/,
			    loader: 'babel-loader',
			    /*query: {
			        presets: ['es2015']
		        }*/

			},
			{
				test:  /\.html$/,
				loader: "html-withimg-loader"
			}
		]

	},

	plugins: [
		new webpack.BannerPlugin("XXZFY8版权内容"),
		new htmlWebpackPlugin({
			template: __dirname + "/public/index.html"
		})

	],

	devServer: {
		contentBase: "./public/",
		historyApiFallback: true,
		// inline: true
	}

}